const a = async function (
  _,
  { row },
  _01,
  { dc: { open, close }, xe: { get } }
) {
  const layout = { id: "c8a3f91feed448c18c7f1d6b0fc9d48c" };
  const modal = {
    title: "编辑政策标签",
    width: "55vw",
    height: document.body.clientHeight * 0.65,
    defaultFullscreen: false,
    destroyOnClose: false,
    maskClosable: false,
    open: true,
    centered: true,
    showCancelBtn: true,
  };
  const inner = {
    onOk: async function (
      _,
      { origin, memory },
      { dc: { http, message, validate } }
    ) {
      const validateRes = await validate();
      if (validateRes["7c648260456e42158331dbdf422be6a4"] !== true) return;
      const params = get(origin, "7c648260456e42158331dbdf422be6a4", {});
      const fileList = get(memory, "files", []);
      params.fileAddress = fileList.length ? fileList[0].FILEPATH : "";
      params.files = undefined;
      const {
        type: { value, label },
      } = params;
      params.typeCode = value;
      params.typeName = label;
      params.type = undefined;
      const { code, msg } = await http.post(
        { url: "/qyk/tagPolicy/modifyTag", data: { ...params } },
        { isTransformResponse: false }
      );
      if (code !== 200) {
        message.error(msg);
      } else {
        close(true);
      }
    },
  };
  const { typeCode, typeName, fileAddress } = row;
  const files = fileAddress ? [fileAddress] : [];
  open({
    inner,
    layout,
    modal,
    transfer: {
      ...row,
      type: {
        value: typeCode,
        label: typeName,
      },
      files,
    },
  });
};
